//
//  HTCommentShowView.m
//  TruckUser
//
//  Created by Ting Han on 2017/10/31.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTCommentShowView.h"
#import "UIView+Layout.h"

@interface HTCommentShowView()

@property (nonatomic) CGRect myFrame;

@end
@implementation HTCommentShowView
- (instancetype)initWithFrame:(CGRect)frame Title:(NSString *)title withHightComment:(BOOL)isHight{
    self = [self initWithFrame:frame];
    if (self) {
        self.myFrame = frame;
        self.titleLabel.text = title;
        if (isHight) {
            self.iconImageView.image = [UIImage imageNamed:@"icon_noselect_handparise"];
        }else{
            self.iconImageView.image = [UIImage imageNamed:@"icon_handparise_noselect_bottom"];
        }
        [self.titleLabel sizeToFit];
        self.titleLabel.centerY = self.iconImageView.centerY;
        self.frame = CGRectMake(self.myFrame.origin.x, self.myFrame.origin.y, 10 + self.iconImageView.width + self.titleLabel.width+15, 4 + self.iconImageView.height);
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}
- (void)setupView{
    self.backgroundColor = kGreenColor;
    self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 2, 20, 20)];
    [self addSubview:self.iconImageView];
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.iconImageView.right + 5, 2, 20, 20)];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.font = [UIFont systemFontOfSize:12];
    self.titleLabel.centerY = self.iconImageView.centerY;
    [self addSubview:self.titleLabel];
    
}

@end
